home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Amiga Classic Collection
/
The Amiga Classic Collection - Disc 1.iso
/
Education
/
ED16-CrosswordCreator.DMS
/
ED16-CrosswordCreator.adf
/
Source
/
CPCMenu.mod
< prev
next >
Wrap
Text File
|
1991-07-13
|
4KB
|
139 lines
IMPLEMENTATION MODULE CPCMenu;
IMPORT Arts;
IMPORT CPCGlobal;
IMPORT IntuiIO;
IMPORT Menus;
IMPORT SYSTEM;
VAR
menupresent: BOOLEAN;
PROCEDURE ShowCommands;
BEGIN
IF menupresent THEN
Menus.MenuOff(CPCGlobal.window);
menupresent:=FALSE;
END;
Menus.SetMenu(0,100,SYSTEM.ADR(CPCGlobal.msg[84]));
Menus.SetItem(0,0,300,SYSTEM.ADR(CPCGlobal.msg[83]),"\o");
Menus.SetItem(0,1,0,SYSTEM.ADR(CPCGlobal.msg[56]),"\o");
Menus.SetItem(0,2,0,SYSTEM.ADR(CPCGlobal.msg[58]),"\o");
Menus.SetItem(0,3,0,SYSTEM.ADR(CPCGlobal.msg[57]),"\o");
Menus.SetItem(0,4,0,SYSTEM.ADR(" "),"\o");
Menus.SetItem(0,5,0,SYSTEM.ADR(CPCGlobal.msg[60]),"\o");
Menus.SetMenu(1,100,SYSTEM.ADR(CPCGlobal.msg[85]));
Menus.SetItem(1,0,300,SYSTEM.ADR(CPCGlobal.msg[1]),"\o");
Menus.SetItem(1,1,0,SYSTEM.ADR(CPCGlobal.msg[53]),"\o");
Menus.SetItem(1,2,0,SYSTEM.ADR(CPCGlobal.msg[59]),"\o");
Menus.SetItem(1,3,0,SYSTEM.ADR(CPCGlobal.msg[86]),"\o");
Menus.SetItem(1,4,0,SYSTEM.ADR(CPCGlobal.msg[87]),"\o");
Menus.SetMenu(2,100,SYSTEM.ADR(CPCGlobal.msg[68]));
Menus.SetItem(2,0,300,SYSTEM.ADR(CPCGlobal.msg[48]),"\o");
Menus.SetItem(2,1,0,SYSTEM.ADR(CPCGlobal.msg[63]),"\o");
Menus.SetItem(2,2,0,SYSTEM.ADR(CPCGlobal.msg[67]),"\o");
Menus.SetItem(2,3,0,SYSTEM.ADR(CPCGlobal.msg[54]),"\o");
Menus.SetItem(2,4,0,SYSTEM.ADR(CPCGlobal.msg[55]),"\o");
menupresent:=Menus.MenuOn(CPCGlobal.window);
IF (CPCGlobal.search=CPCGlobal.off)&(CPCGlobal.show=CPCGlobal.on) THEN
Menus.ItemDisable(0,4,-1);
ELSIF (CPCGlobal.search=CPCGlobal.off) AND (CPCGlobal.show=CPCGlobal.off) THEN
Menus.ItemDisable(0,0,-1);
Menus.ItemDisable(0,1,-1);
Menus.ItemDisable(0,2,-1);
Menus.ItemDisable(0,3,-1);
Menus.ItemDisable(0,4,-1);
Menus.SetItem(1,0,300,SYSTEM.ADR(CPCGlobal.msg[2]),"\o");
Menus.ItemDisable(1,1,-1);
Menus.ItemDisable(1,2,-1);
Menus.ItemDisable(1,3,-1);
Menus.ItemDisable(1,4,-1);
Menus.ItemDisable(2,0,-1);
Menus.ItemDisable(2,1,-1);
Menus.ItemDisable(2,2,-1);
Menus.ItemDisable(2,3,-1);
Menus.ItemDisable(2,4,-1);
ELSIF (CPCGlobal.search=CPCGlobal.on) THEN
Menus.ItemDisable(0,0,-1);
Menus.ItemDisable(0,1,-1);
Menus.ItemDisable(0,2,-1);
Menus.ItemDisable(0,3,-1);
Menus.ItemDisable(0,4,-1);
Menus.SetItem(1,0,300,SYSTEM.ADR(CPCGlobal.msg[3]),"\o");
Menus.ItemDisable(1,1,-1);
Menus.ItemDisable(1,2,-1);
Menus.ItemDisable(1,3,-1);
Menus.ItemDisable(1,4,-1);
Menus.ItemDisable(2,0,-1);
Menus.ItemDisable(2,1,-1);
Menus.ItemDisable(2,2,-1);
Menus.ItemDisable(2,3,-1);
Menus.ItemDisable(2,4,-1);
END;
IF CPCGlobal.hori+CPCGlobal.vert>0 THEN
Menus.ItemDisable(1,3,-1);
Menus.ItemDisable(1,4,-1);
END;
END ShowCommands;
PROCEDURE AllMenusOff;
BEGIN
IF menupresent THEN
Menus.ItemDisable(0,-1,-1);
Menus.ItemDisable(0,0,-1);
Menus.ItemDisable(0,1,-1);
Menus.ItemDisable(0,2,-1);
Menus.ItemDisable(0,3,-1);
Menus.ItemDisable(0,4,-1);
Menus.ItemDisable(0,5,-1);
Menus.ItemDisable(1,-1,-1);
Menus.ItemDisable(1,0,-1);
Menus.ItemDisable(1,1,-1);
Menus.ItemDisable(1,2,-1);
Menus.ItemDisable(1,3,-1);
Menus.ItemDisable(1,4,-1);
Menus.ItemDisable(2,-1,-1);
Menus.ItemDisable(2,0,-1);
Menus.ItemDisable(2,1,-1);
Menus.ItemDisable(2,2,-1);
Menus.ItemDisable(2,3,-1);
Menus.ItemDisable(2,4,-1);
END;
END AllMenusOff;
BEGIN
menupresent:=FALSE;
CLOSE
(* must close menu BEFORE closing the window!!! *)
IF (CPCGlobal.window#NIL) THEN
IF menupresent THEN
Menus.MenuOff(CPCGlobal.window);
menupresent:=FALSE;
END;
IntuiIO.CloseWindow(CPCGlobal.window);
CPCGlobal.window:=SYSTEM.CAST(IntuiIO.WINDOW,NIL);
END;
IF (CPCGlobal.screen#NIL) THEN
IntuiIO.CloseScreen(CPCGlobal.screen);
CPCGlobal.screen:=SYSTEM.CAST(IntuiIO.SCREEN,NIL);
END;
END CPCMenu.